<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>客户信息显示</title>
    
	<link rel="stylesheet" type="text/css" href="css/commonStyle.css"></link>
	
	<script type="text/javascript" src="dwr/engine.js"></script>
	<script type="text/javascript" src="dwr/util.js"></script>
	<script type="text/javascript" src="dwr/interface/customerAjax.js"></script>
	<script type="text/javascript" src="js/JQuery.js"></script>
	<script type="text/javascript" src="lhgdialog/lhgdialog.min.js"></script>
	<script type="text/javascript" src="js/common.js"></script>
	<script type="text/javascript" src="js/customerList.js"></script>

  </head>
  
  <body>
	<center>
	
	<!-- 查询条件区域 -->
	<form action="CustomerInfo_queryByProperty.action" method="post">
		<table class="fullTableStyle">
			<thead>
				<tr>
					<td class="queryTableHead">按条件查询用户信息：</td>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td>
						<select name="queryCondition">
							<option value="name" <s:property value="#request.name"/> >客户名称</option>
							<option value="website" <s:property value="#request.website"/> >公司网址</option>
							<option value="phone" <s:property value="#request.phone"/> >公司电话</option>
							<option value="registor" <s:property value="#request.registor"/> >登记人</option>
							<option value="address" <s:property value="#request.address"/> >客户地址</option>
							<option value="province" <s:property value="#request.province"/> >所属省份</option>
							<option value="city" <s:property value="#request.city"/> >所属城市</option>
							<option value="zipCode" <s:property value="#request.zipCode"/> >公司邮编</option>
							<option value="bankAccount" <s:property value="#request.bankAccount"/> >银行帐号</option>
						</select>
						<input type="text" name="queryValue" value="<s:property value='#request.queryValue' />" />
						&nbsp;&nbsp;&nbsp;&nbsp;
						客户性质：
						<select name="property">
							<option value="0">--选择客户属性--</option>
							<s:iterator value="customerProperties" var="property">
	    						<s:if test="#property.name != ''"> 
			    					<option value="<s:property value='#property.id' />" 
		    							<s:if test="#property.id == #request.propertyValue">
		    								selected="selected"
		    							</s:if>
			    					 ><s:property value="#property.name" /></option>
	    						</s:if>
		    				</s:iterator>
						</select>
						&nbsp;&nbsp;&nbsp;&nbsp;
						客户类型：
						<select name="category">
							<option value="0">--选择客户类型--</option>
							<s:iterator value="customerCategories" var="category">
	    						<s:if test="#category.name != ''">
			    					<option value="<s:property value='#category.id' />"
			    						<s:if test="#category.id == #request.categoryValue">
		    								selected="selected"
		    							</s:if>
			    					 ><s:property value="#category.name" /></option>
	    						</s:if>
	    					</s:iterator>
						</select><br/>
						客户级别：
						<select name="grade">
							<option value="0">--选择客户级别--</option>
							<s:iterator value="grades" var="grade">
	    						<s:if test="#grade.name != ''">
			    					<option value="<s:property value='#grade.id' />" 
			    						<s:if test="#grade.id == #request.gradeValue">
		    								selected="selected"
		    							</s:if>
			    					><s:property value="#grade.name" /></option>
	    						</s:if>
	    					</s:iterator>
						</select>
						&nbsp;&nbsp;&nbsp;&nbsp;
						开户银行：
						<select name="bank">
							<option value="0">--选择开户银行--</option>
							<s:iterator value="customerBanks" var="bank">
	    						<s:if test="#bank.name != ''">
			    					<option value="<s:property value='#bank.id' />"
			    						<s:if test="#bank.id == #request.bankValue">
		    								selected="selected"
		    							</s:if>
			    					><s:property value="#bank.name" /></option>
	    						</s:if>
	    					</s:iterator>
						</select>
						&nbsp;&nbsp;&nbsp;&nbsp;
						客户来源：
						<select name="customerSource">
							<option value="0">--选择客户来源--</option>
							<s:iterator value="customerSources" var="source">
	    						<s:if test="#source.name != ''">
			    					<option value="<s:property value='#source.id' />"
			    						<s:if test="#source.id == #request.customerSourceValue">
		    								selected="selected"
		    							</s:if>
			    					 ><s:property value="#source.name" /></option>
	    						</s:if>
	    					</s:iterator>
						</select>
						<input type="submit" value="" style="background: url('img/query.png');" class="queryLogo" />
					</td>
				</tr>
			</tbody>
		</table>
	</form>
	<!-- 查询条件区域 -->
	
	<!-- 结果显示区域 -->
    <table class="fullTableStyle">
		<!-- 表头信息 -->
    	<thead>
    		<tr class="theadNoTitle">
    			<td colspan="12"><span>客户信息显示</span>
    			<a href="#" onclick="return showAddInputDialog()" >&cong;添加用户</a></td>
    		</tr>
    		<tr>
    			<td><input type="checkbox" onclick="checkAll(this)" /></td>
    			<td>编号</td>
    			<td>客户名称</td>
    			<td>客户性质</td>
    			<td>客户类型</td>
    			<td>客户级别</td>
    			<td>公司网址</td>
    			<td>公司电话</td>
    			<td>登记人</td>
    			<td>查看详细</td>
    			<td>修改</td>
    			<td>删除</td>
    		</tr>
    	</thead>
		<!-- 表头信息 -->

		<!-- 主体区域 -->
    	<tbody>
	    	<s:iterator value="infoes" var="info" >
	    		<tr>
	    			<td><input type="checkbox" name="customerInfoIds" value="<s:property value="#info.id" />" /></td>
	    			<td><s:property value="#info.id" /></td>
	    			<td><s:property value="#info.name" /></td>
	    			<td><s:property value="#info.ddInfoByPropertyId.name" /></td>
	    			<td><s:property value="#info.ddInfoByCategoryId.name" /></td>
	    			<td><s:property value="#info.grade.name" /></td>
	    			<td><s:property value="#info.website" /></td>
	    			<td><s:property value="#info.phone" /></td>
	    			<td><s:property value="#info.registor" /></td>
	    			<td><input type="button" class="showDetailStyle" style="background: url('img/detail.png');" onclick="showDetail(${ info.id })" /></td>
	    			<td><input type="button" style="background: url('img/edit.png');" class="littleLogo" onclick="showInputDialog(${ info.id })" /></td>
	    			<td><input type="button" style="background: url('img/del.png');" class="littleLogo" onclick="delCustomerInfo(${ info.id })"></td>
	    		</tr>
	    	</s:iterator>
    	</tbody>
		<!-- 主体区域 -->
    	
    	<!-- 表格底部（分页信息显示） -->
    	<tfoot>
    		<tr>
    			<td colspan="12">
    				<ul>
    					<!-- 页面记录数控制 -->
    					<li>
    						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;条/页
	    					<span class="countEveryPage">
	    						<s:if test="#request.flag == true">
				    				<a href="#" onclick="return pageRequest(10 ,true)">10</a>
			    				</s:if>
			    				<s:else>
				    				<a href="CustomerInfo_list.action?pageSize=10">10</a>
			    				</s:else>
	    					</span>
		    				<span class="countEveryPage">
	    						<s:if test="#request.flag == true">
				    				<a href="#" onclick="return pageRequest(15 ,true)">15</a>
			    				</s:if>
			    				<s:else>
				    				<a href="CustomerInfo_list.action?pageSize=15">15</a>
			    				</s:else>
		    				</span>
    					</li>
    					<!-- 页面记录数控制 -->
    					
    					<!-- 分页超链接 -->
		    			<li>
		    				<s:if test="#request.flag == true">
			    				<a href="#" onclick="return pageRequest(${page.pageCount} ,false)">尾页</a>
		    				</s:if>
		    				<s:else>
			    				<a href="CustomerInfo_list.action?pageNumber=${ page.pageCount }" >尾页</a>
		    				</s:else>
		    			</li>
		    			<s:if test="page.hasNext">
			    			<li>
			    				<s:if test="#request.flag == true">
				    				<a href="#" onclick="return pageRequest(${page.pageNumber + 1} ,false)">下一页</a>
			    				</s:if>
			    				<s:else>
				    				<a href="CustomerInfo_list.action?pageNumber=${ page.pageNumber + 1 }" >下一页</a>
			    				</s:else>
			    				
			    			</li>
		    			</s:if>
		    			<s:if test="page.hasPre">
			    			<li>
			    				<s:if test="#request.flag == true">
				    				<a href="#" onclick="return pageRequest(${page.pageNumber - 1} ,false)">上一页</a>
			    				</s:if>
			    				<s:else>
				    				<a href="CustomerInfo_list.action?pageNumber=${ page.pageNumber - 1 }" >上一页</a>
			    				</s:else>
			    			</li>
		    			</s:if>
		    			<li>
		    				<s:if test="#request.flag == true">
			    				<a href="#" onclick="return pageRequest(1 ,false)">首页</a>
		    				</s:if>
		    				<s:else>
			    				<a href="CustomerInfo_list.action?pageNumber=1" >首页</a>
		    				</s:else>
		    			</li>
		    			<!-- 分页超链接 -->
		    			
		    			<!-- 页面信息显示 -->
		    			<li class="tfootContStyle"><input type="button" value="批量删除" onclick="return delSelectedCustomer()" /></li>
    					<li class="tfootContStyle"><span>共&nbsp;<s:property value="page.pageCount" />&nbsp;页,&nbsp;<s:property value="page.recordCount" />&nbsp;条记录,这是第&nbsp;<s:property value="page.pageNumber" />&nbsp;页</span></li>
		    			<li class="tfootContStyle"><span>此页显示第&nbsp;<s:property value="page.beginIndex + 1" />&nbsp;条到第&nbsp;<s:property value="page.endIndex" />&nbsp;条记录</span></li>
		    			<!-- 页面信息显示 -->
		    		</ul>
    			</td>
    		</tr>
    	</tfoot>
    	<!-- 表格底部（分页信息显示） -->
    </table>
    </center>
  </body>
</html>
